//插入banner数据
const Banner = require("../model/banner");
const urlPath = path.join(__dirname, "../public/images/banner");
try {
  let bannerList = fs.readdirSync(urlPath);
  bannerList.forEach((item) => {
    Banner.create({ url: item })
      .then((res) => console.log(res))
      .catch((err) => console.log(err));
  });
} catch (err) {
  console.log(err);
}
